package com.dp.future;

/**
 * @author 金鑫
 * 返回Data对象，立即返回FutureData，并开启ClientThread装配RealData
 */
public class Client {
    public Data request(final String queryStr){
        final FutureData future = new FutureData();
        Thread thread = new Thread(){
            public void run(){
                RealData realdata = new RealData(queryStr);
                future.setRealData(realdata);
            }
        };
//        thread.setDaemon(true);
        thread.start();
        return future;
    }
}
